//
//  InputView.m
//  KeleAppProject
//
//  Created by 周岑 on 2018/1/22.
//  Copyright © 2018年 Cen Zhou. All rights reserved.
//

#import "InputView.h"
#import "LogoNumberView.h"
@interface InputView()
@property (nonatomic, strong)UIView * inputContentView;
@end

@implementation InputView

- (instancetype)init{
    if (self = [super init]) {
        [self loadSubviewsOnInput];
    }
    return self;
}

- (void) loadSubviewsOnInput{
    
    UIView *lineView = [[UIView alloc]init];
    lineView.backgroundColor = KLColor_B3;
    [self addSubview:lineView];
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.equalTo(self);
        make.height.mas_equalTo(1);
    }];
    
    UIView *inputContentView = [[UIView alloc]init];
    inputContentView.backgroundColor = KLColor_C1;
    self.inputContentView = inputContentView;
    [self addSubview:inputContentView];
    [inputContentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.left.equalTo(self).offset(15*WIDTH);
        make.width.mas_equalTo(232*WIDTH);
        make.height.mas_equalTo(36*HEIGHT);
    }];
    
    UIImageView *inputImage  = [[UIImageView alloc]init];
    inputImage.image = [UIImage imageNamed:@"xiangqing_icon_pinglun"];
    [inputContentView addSubview:inputImage];
    [inputImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(inputContentView);
        make.left.equalTo(inputContentView).offset(10*WIDTH);
        make.width.height.mas_equalTo(16*WIDTH);
    }];
    
    UITextField *inputTF = [[UITextField alloc]init];
    inputTF.placeholder = @"评论一下...";
    inputTF.textColor = KLColor_B6;
    inputTF.font = [UIFont fontWithName:@"PingFangSC-Regular" size:14*WIDTH];
    [inputContentView addSubview:inputTF];
    [inputTF mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(inputContentView);
        make.left.equalTo(inputImage.mas_right).offset(8*WIDTH);
        make.right.equalTo(inputContentView);
    }];
    
    
    LogoNumberView *collecView = [[LogoNumberView alloc]init];
    [self addSubview:collecView];
    collecView.signalDelegate = [RACSubject subject];
    
    
    [collecView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.left.equalTo(inputContentView.mas_right).offset(26*WIDTH);
        make.width.mas_equalTo(30*WIDTH);
        make.height.mas_equalTo(30*HEIGHT);
    }];
    [collecView setImageValuesWithDataDic:@{@"imageStr":@"home_icon_shouchang",@"size":@"30",@"tag":@"0"}];
    
    LogoNumberView *shareView = [[LogoNumberView alloc]init];
    [self addSubview:shareView];
    [shareView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.left.equalTo(collecView.mas_right).offset(18*WIDTH);
        make.width.mas_equalTo(30*WIDTH);
        make.height.mas_equalTo(30*HEIGHT);
    }];
    
    [shareView setImageValuesWithDataDic:@{@"imageStr":@"xiangqing_icon_fenxiang",@"size":@"30",@"tag":@"1"}];
    
    
    
}





@end
